<div ng-controller="order as gt">
	<section class="content-header">
		<h1>
			{{title}}<small></small>
		</h1>
	</section>
	<section class="content">
		<div class="box box-default">
			<div class="col-md-12">
				<div class="box-body">
					<alertdanger></alertdanger>
					<alertsuccess></alertsuccess>
					<form role="form">
						<div class="box-body">

							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">搜索需要添加到订单的货物</h3>
								</div>
								<div class="box-body">
									<div class="form-group" ng-init="findallgoodstype();">
										<label>商品类型</label> <select ng-change="goodstypechange();"
											ng-model="selectedgoodstype"
											ng-options="gs.name for gs in goodstypeselect"
											class="form-control select2" style="width: 100%;">
											<option ng－value="-1">--请选择--</option>
										</select>
									</div>
									<div class="form-group">
										<label>货号</label> <input maxlength="20" ng-model="psn"
											class="form-control" type="text" placeholder="请输入货号进行搜索">
									</div>
									<div ng-show="navcategoryshow" class="form-group"
										ng-init="findNavAll();">
										<label>一级分类</label> <select ng-change="navchange();"
											ng-model="selectednav"
											ng-options="gs.name for gs in navselect"
											class="form-control select2" style="width: 100%;">
											<option ng－value="-1">--请选择--</option>
										</select>
									</div>
									<div ng-show="ltypecategoryshow" class="form-group">
										<label>二级分类</label> <select ng-change="ltypechange();"
											ng-model="selectedltype"
											ng-options="gs.name for gs in ltypeselect"
											class="form-control select2" style="width: 100%;">
											<option ng－value="-1">--请选择--</option>
										</select>
									</div>
									<div ng-show="stypecategoryshow" class="form-group">
										<label>三级分类</label> <select ng-model="selectedstype"
											ng-options="gs.name for gs in stypeselect"
											class="form-control select2" style="width: 100%;">
											<option ng－value="-1">--请选择--</option>
										</select>
									</div>
									<div class="form-group">
										<button class="btn btn-default btn-block btn-sm"
											ng-click="filterSearchProduct();">搜索货物</button>
									</div>
								</div>
							</div>
							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">货物搜索结果列表</h3>
								</div>

								<div class="box-body table-responsive no-padding">
									<table class="table table-hover">
										<tr>
											<th>图片</th>
											<th>货物名称</th>
											<th>库存</th>
											<th>所属商品类型</th>
											<th>所属品牌</th>
											<th>成本价格</th>
											<th>会员价格</th>
											<th>市场价格</th>
											<th>销售价格</th>
											<th>操作</th>
										</tr>
										<tr ng-repeat="at in searchresult">
											<td><img class="direct-chat-img"
												ng-src="{{basepath}}{{at.mainimg}}" alt="img" /></td>
											<td>{{at.productname}}</td>
											<td>{{at.stock}}</td>
											<td>{{at.goodstypename}}</td>
											<td>{{at.brandname}}</td>
											<td>{{at.cost}}</td>
											<td>{{at.memberprice}}</td>
											<td>{{at.price}}</td>
											<td>{{at.saleprice}}</td>
											<td><button ng-click="pushToSelectedProducts($index,at)"
													class=".btn-xs">添加</button></td>
										</tr>
									</table>
								</div>
							</div>
							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">已添加到订单的货物</h3>
								</div>
								<div class="box-body">
									<div class="col-md-4" ng-repeat="at in selectedproducts">
										<div class="box box-widget widget-user">
											<div class="widget-user-header bg-green">
												{{at.brandname}}-{{at.productname}}</div>
											<div class="widget-user-image">
												<img class="img-circle" src="{{at.mainimg}}" alt="img">
											</div>
											<div class="box-footer">
												<div class="row">
													<div class="col-sm-4 border-right">
														<div class="description-block">
															<h5 class="description-header">{{at.cost|currency:"¥"}}</h5>
															<span class="description-text">成本价</span>
														</div>
													</div>
													<div class="col-sm-4 border-right">
														<div class="description-block">
															<h5 class="description-header">{{at.memberprice|currency:"¥"}}</h5>
															<span class="description-text">会员价</span>
														</div>
													</div>
													<div class="col-sm-4">
														<div class="description-block">
															<h5 class="description-header">{{at.stock|number}}</h5>
															<span class="description-text">库存</span>
														</div>
													</div>
												</div>
											</div>
										</div>
										<button ng-click="removeSelectedProducts($index)"
											class=".btn-xs">删除</button>
									</div>
								</div>
							</div>


							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">搜索会员地址及开票信息</h3>
								</div>
								<div class="box-body">
									<div class="form-group">
										<label>输入会员账号或者手机号</label> <input maxlength="20"
											ng-model="loginname" class="form-control" type="text"
											placeholder="请输入会员账号进行搜索">
									</div>
								</div>
								<div class="form-group">
									<button class="btn btn-default btn-block btn-sm"
										ng-click="filterSearchMemberDeliveraddressAndInvoice();">搜索会员地址及开票信息</button>
								</div>
							</div>
							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">会员地址搜索结果列表</h3>
								</div>

								<div class="box-body table-responsive no-padding">
									<table class="table table-hover">
										<tr>
											<th>收货人</th>
											<th>国家</th>
											<th>省份</th>
											<th>城市</th>
											<th>区域</th>
											<th>街道</th>
											<th>详细地址</th>
											<th>手机</th>
											<th>别名</th>
											<th>操作</th>
										</tr>
										<tr ng-repeat="at in memberdeliveraddresssearchresult">
											<td>{{at.consignee}}</td>
											<td>{{at.country}}</td>
											<td>{{at.province}}</td>
											<td>{{at.city}}</td>
											<td>{{at.district}}</td>
											<td>{{at.street}}</td>
											<td>{{at.detail}}</td>
											<td>{{at.mobile}}</td>
											<td>{{at.tag}}</td>
											<td><button
													ng-click="pushToSelectedMemberDeliveraddress($index,at)"
													class=".btn-xs">添加</button></td>
										</tr>
									</table>
								</div>
							</div>
							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">已添加到订单的收获地址</h3>
								</div>
								<div class="box-body">
									<div class="col-md-12">
										<table class="table table-hover">
											<tr ng-repeat="at in selectedmda">
												<td>{{at.consignee}}</td>
												<td>{{at.country}}</td>
												<td>{{at.province}}</td>
												<td>{{at.city}}</td>
												<td>{{at.district}}</td>
												<td>{{at.street}}</td>
												<td>{{at.detail}}</td>
												<td>{{at.mobile}}</td>
												<td>{{at.tag}}</td>
												<td><button
														ng-click="removeSelectedMemberDeliveraddress($index)"
														class=".btn-xs">删除</button></td>
											</tr>
										</table>
									</div>
								</div>
							</div>

							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">会员开票信息搜索结果列表</h3>
								</div>

								<div class="box-body table-responsive no-padding">
									<table class="table table-hover">
										<tr>
											<th>开票抬头</th>
											<th>操作</th>
										</tr>
										<tr ng-repeat="at in memberinvoicesearchresult">
											<td>{{at.title}}</td>
											<td><button
													ng-click="pushToSelectedMemberInvoice($index,at)"
													class=".btn-xs">添加</button></td>
										</tr>
									</table>
								</div>
							</div>
							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">已添加到订单的开票信息</h3>
								</div>
								<div class="box-body">
									<div class="col-md-12">
										<table class="table table-hover">
											<tr ng-repeat="at in selectedmi">
												<td>{{at.title}}</td>
												<td><button
														ng-click="removeSelectedMemberInvoice($index)"
														class=".btn-xs">删除</button></td>
											</tr>
										</table>
									</div>
								</div>
							</div>

							<div class="box box-success" ng-init="filterLogisticsBusiness();">
								<div class="box-header with-border">
									<h3 class="box-title">选择物流商</h3>
								</div>
								<div class="box-body">
									<div class="form-group">
										<div ng-repeat="at in logisticslists">
											<label> <input type="radio" ng-model="logisticsid"
												name="name" ng-value="{{at.logisticsid}}" class="flat-red"
												ng-checked="true">{{at.logisticsname}}
											</label>
										</div>
									</div>
								</div>
							</div>

							<div class="box box-success" ng-init="filterPayment();">
								<div class="box-header with-border">
									<h3 class="box-title">选择支付方式</h3>
								</div>
								<div class="box-body">
									<div class="form-group">
										<div ng-repeat="at in paymentlist">
											<label> <input type="radio" ng-model="paymentid"
												name="name1" ng-value="{{at.id}}" class="flat-red"
												ng-checked="true">{{at.paymentname}}
											</label>
										</div>
									</div>
								</div>
							</div>



							<div class="form-group">
								<label>订单运费</label> <input maxlength="100" required="required"
									ng-model="freight" class="form-control" type="text"
									placeholder="请输入订单运费">
							</div>
							<div class="form-group">
								<label>订单总价</label> <input maxlength="100" ng-model="shouldpay"
									class="form-control" type="text" placeholder="请输入订单总价">
							</div>
						</div>
						<div class="box-footer">
							<button ng-show="savebtn.show" type="button"
								class="btn btn-primary" ng-click="save();">提交订单</button>
							<button ng-show="updatebtn.show" type="button"
								class="btn btn-primary" ng-click="update();">更新订单</button>
						</div>
					</form>
				</div>
			</div>
			<div class="box-footer"></div>
		</div>
	</section>
</div>
